package hust.music.dao.base;

import java.util.List;

public interface JpaDao {

	public <T> void save(T t);

	public <T> void delete(T t);

	public <T> void delete(Class<T> entityClass, Integer id);

	public <T> void update(T t);

	public <T> T get(Class<T> entityClass, Integer id);

	public <T> List<T> findAll(Class<T> entityClass, String jpql);

	public <T> List<T> findAll(Class<T> entityClass, String jpql, Object param);

	public <T> List<T> findAll(Class<T> entityClass, String jpql,
			Object[] params);

	public <T> List<T> findByPage(final Class<T> entityClass,
			final String jpql, final int firstResult, final int maxResult);

	public <T> List<T> findByPage(final Class<T> entityClass,
			final String jpql, final Object param, final int firstResult,
			final int maxResult);

	public <T> List<T> findByPage(final Class<T> entityClass,
			final String jpql, final Object[] params, final int firstResult,
			final int maxResult);

}
